import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import './i18n'
import App from './App'
import { registerSW } from './utils/serviceWorker'

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
)

// Register service worker for caching and offline support
registerSW({
  onSuccess: () => {
    console.log('Service worker registered successfully')
  },
  onUpdate: () => {
    console.log('New content available, please refresh')
  },
  onOfflineReady: () => {
    console.log('App ready to work offline')
  }
})

